<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box1 {
            display: flex;
            /*垂直布局*/
            flex-direction: column;
            width: 300px;
            height: 300px;
            background-color: #999999;
        }

        .box1 div {
            /*他们宽度都占80%*/
            width: 80%;
        }

        .box1 .div1 {
            background-color: yellow;
            /*宽度是100px*/
            flex-basis: 100px;
        }

        .box1 .div2 {
            /*剩余宽度占70%*/
            background-color: coral;
            flex-basis: 10rem;
        }

        .box1 .div3 {
            background-color: lightgreen;
            /*剩余宽度占30%*/
            flex-basis: 70%;
        }
    </style>
</head>
<body>
<div class="box1">
    <div class="div1">1</div>
    <div class="div2">2</div>
    <div class="div3">3</div>
</div>
</body>
</html>